/**
 * 
 */
package ar.edu.unq.agenda.ui;


import org.uqbar.arena.windows.WindowOwner;
import ar.unq.edu.agenda.domain.Contact;
import ar.unq.edu.agenda.home.Agenda;

/**
 * Representa una ventana de carga de un nuevo Contacto
 * @author nicolas
 *
 */
public class ContactWindowCreate extends ContactWindow {

	public ContactWindowCreate(WindowOwner owner, Contact model) {
		super(owner, model);
	}
	
	
	public ContactWindowCreate(WindowOwner owner)
	{
		super(owner, new Contact());
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;


	@Override
	public String getButtonCaption() {
		return "Crear!";
	}

	public void executeTask() {		
		Agenda.getHome(Contact.class).create(this.getModel());	
		this.showInfo("El contacto ha sido creado");
		this.close();
	}
	

}
